home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol2 / Archives / Plain / ma93.lha / FastIO_II / ASyncExample.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-19  |  1.3 KB  |  49 lines

  1. ;/* ASyncExample.c - Execute me to compile me with SAS/C 5.10b
  2. sc data=near nominc strmer streq nostkchk saveds ign=73 AsyncExample.c
  3. ;LC -cfistq -v -y -j73 ASyncExample.c
  4. slink FROM LIB:c.o,ASyncExample.o TO ASyncExample LIBRARY lib:sc.lib,LIB:Amiga.lib,asyncio.o
  5. quit ;*/
  6.  
  7. /* (c)  Copyright 1993 Commodore-Amiga, Inc.   All rights reserved. */
  8. /* The information contained herein is subject to change without    */
  9. /* notice, and is provided "as is" without warranty of any kind,    */
  10. /* either expressed or implied.  The entire risk as to the use of   */
  11. /* this information is assumed by the user.                         */
  12.  
  13.  
  14. #include <exec/types.h>
  15. #include <exec/exec.h>
  16. #include <dos/dos.h>
  17. #include <dos/dosextens.h>
  18. #include <stdio.h>
  19.  
  20. #include <clib/exec_protos.h>
  21. #include <clib/dos_protos.h>
  22.  
  23. #include "asyncio.h"
  24.  
  25. #ifdef LATTICE
  26. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  27. int chkabort(void) { return(0); }
  28. #endif
  29.  
  30. VOID main(VOID)
  31. {
  32. struct AsyncFile *in;
  33. LONG              num;
  34. struct AsyncFile *out;
  35.  
  36.     if (in = OpenAsync("x", MODE_READ, 8192))
  37.     {
  38.         if (out = OpenAsync("t:test_sync", MODE_WRITE, 8192))
  39.         {
  40.             while ((num = ReadCharAsync(in)) >= 0)
  41.             {
  42.                 WriteCharAsync(out,num);
  43.             }
  44.             CloseAsync(out);
  45.         }
  46.         CloseAsync(in);
  47.     }
  48. }
  49.